//package com.example.callcenter.service.impl;
//
//import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
//import com.example.callcenter.dto.TaskDTO;
//import com.example.callcenter.entity.CallTask;
//import com.example.callcenter.mapper.CallTaskMapper;
//import com.example.callcenter.service.TaskService;
//import com.example.callcenter.util.UserContext;
//import org.springframework.stereotype.Service;
//
//import java.time.LocalDateTime;
//
//@Service
//public class TaskServiceImpl extends ServiceImpl<CallTaskMapper, CallTask> implements TaskService {
//
//    @Override
//    public void createTask(TaskDTO taskDTO) {
//        CallTask task = new CallTask();
//        task.setTaskName(taskDTO.getTaskName());
//        task.setTotalCount(taskDTO.getTotalCount());
//        task.setCreateUserId(UserContext.getUserId());
//        task.setCreateTime(LocalDateTime.now());
//        task.setStatus(0); // 0-未开始
//        baseMapper.insert(task);
//    }
//
//    @Override
//    public void startTask(Long taskId) {
//        CallTask task = baseMapper.selectById(taskId);
//        task.setStatus(1); // 1-进行中
//        task.setStartTime(LocalDateTime.now());
//        baseMapper.updateById(task);
//        // 实际项目中会在这里触发任务分发逻辑
//    }
//}